<?php

namespace app\serversms\service\sms;
use app\manage\service\ApiBase;

/**
 * @author:      李颖
 * @DateTime:    2017-07-17 09:28:27
 * @Description: 后台 -  短信配置
 */

class Sms extends ApiBase
{
	
	protected $smsLogic = 'app\serversms\logic\Sms';
    protected $smsValidate = 'app\serversms\validate\Sms';
   
    /*添加一个短信配置模板（模板+apikey等）*/
    public function addSms(): array 
    {
        $data = $this->haveIssetReceiveData(['app_id'=>0,'other_app_read'=>'','is_public'=>0,'action'=>' ','description'=>'','sms_info'=>[], 'token'=>' ']);
        return $this->oneStepRun($data, 'serversms/sms/Sms/addSms', 'addSms');
    }

    /*编辑某个短信配置*/
    public function editSms(): array 
    {
        $data = $this->issetReceiveData(['id'=>0,'other_app_read'=>'','is_public'=>0,'action'=>' ','description'=>'','sms_info'=>[], 'token'=>' ']);
        return $this->stepRun($data, 'serversms/sms/Sms/editSms', 'editSms', 'editSms');
    }


    /*获取短信模板配置列表*/
    public function smsList(): array 
    {
    	$data = $this->issetReceiveData(['page'=>1,'listRows'=>15, 'token'=>' ']);
        return $this->stepRun($data, 'serversms/sms/Sms/smsList', 'smsList', 'smsList');
    }

    /*获取某个短信配置详情*/
    public function smsInfo(): array 
    {
    	$data = $this->receiveData(['id'=>0, 'token'=>' ']);
        return $this->stepRun($data, 'serversms/sms/Sms/smsInfo', 'smsInfo', 'smsInfo');
    }

    /*删除某短信配置*/
    public function delOneSms(): array 
    {
    	$data = $this->receiveData(['id'=>0, 'token'=>' ']);
        return $this->stepRun($data, 'serversms/sms/Sms/delOneSms', 'delOneSms', 'delOneSms');
    }

    /*发送短信的日志列表*/
    public function logList(): array 
    {
        $data = $this->haveIssetReceiveData(['page'=>1,'listRows'=>15,'status'=>'','keywords'=>''], []);
        return $this->oneStepRun($data, 'serversms/sms/SmsLog/logList', 'logList');
    }

    


}






